-- msg_pets
-- Create by weism
-- 通知我的宠物信息

return function(lpc)
    -- 先清理下旧的数据
    ME.user.pets = {};

    local count = 0;
    local pets = lpc.pets;
    for k, v in pairs(pets) do
        local pet = Pet.new(k, v);
        ME.user.pets[k] = pet;
        count = count + 1;
    end
    trace("msg_pets", "共有%d个宠物", count);

    -- 刷新下附加属性
    if count > 0 and ME.isInGame then
        PropM.refreshEffect(ME.user, "skill");
        PropM.refreshEffect(ME.user, "equip");
    end   

    -- 发出宠物加载成功事件
    EventMgr.fire(event.LOAD_PET_OK);
end

